//
//  HYSalonTableHeaderView.m
//  KaiJing
//
//  Created by lanou on 16/1/15.
//  Copyright © 2016年 HuangZuCui. All rights reserved.
//

#import "HYSalonTableHeaderView.h"
#import "UIView+WLFrame.h"
@implementation HYSalonTableHeaderView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        _headerImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight/7 *4)];
        [self addSubview:_headerImageView];
        
        _name = [[UILabel alloc] initWithFrame:CGRectMake(30, _headerImageView.height / 10, kScreenWidth - 60, _headerImageView.height / 20 *3)];
        //_name.backgroundColor = kRandomClolor;
        _name.numberOfLines = 2;
        _name.textColor = [UIColor whiteColor];
        [_headerImageView addSubview:_name];
        
        _threadnum = [[UILabel alloc] initWithFrame:CGRectMake((kScreenWidth - 100)/2, _name.bottom + 10, 100, _headerImageView.height / 10 )];
       // _threadnum.backgroundColor = kRandomClolor;
        _threadnum.textColor = [UIColor whiteColor];
        [_headerImageView addSubview:_threadnum];
        
        
        _founderusername = [[UILabel alloc] initWithFrame:CGRectMake(20, _threadnum.bottom + 10, 80, _headerImageView.height / 10)];
        [self addSubview:_founderusername];
        _founderusername.textColor = [UIColor whiteColor];
        _timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(_founderusername.right + 20, _headerImageView.bottom + 10, 120, 30)];
        [self addSubview:_timeLabel];
        
        
        _desc = [[UILabel alloc] initWithFrame:CGRectMake(20, _founderusername.bottom + 10, kScreenWidth - 40, 55)];
        _desc.textColor = [UIColor whiteColor];
        _desc.font = [UIFont systemFontOfSize:12];
        _desc.numberOfLines = 3;
        [self addSubview:_desc];

        _leftButton = [UIButton buttonWithType:(UIButtonTypeSystem)];
        _leftButton.frame = CGRectMake(0, _desc.bottom + 20, kScreenWidth /2, 30);
       // _leftButton.backgroundColor = kRandomClolor;
        [self addSubview:_leftButton];
        [_leftButton setTitle:@"最新" forState:(UIControlStateNormal)];
        _leftButton.titleLabel.textAlignment = NSTextAlignmentCenter;
        
        
        _rightButton = [UIButton buttonWithType:(UIButtonTypeSystem)];
        _rightButton.frame = CGRectMake(_leftButton.right, _desc.bottom + 20, kScreenWidth /2, 30);
       // _rightButton.backgroundColor = kRandomClolor;
        [self addSubview:_rightButton];
        [_rightButton setTitle:@"热门" forState:(UIControlStateNormal)];
        _rightButton.titleLabel.textAlignment = NSTextAlignmentCenter;
        
    }
    return self;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
